package com.drinkian.authentication.controller;

import com.drinkian.entity.RequestResult;
import com.drinkian.authentication.entity.po.User;
import com.drinkian.authentication.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("auth")
public class LoginController {

    @Autowired
    private ILoginService ILoginService;

    @PostMapping("login")
    public RequestResult login(@RequestBody User user) {
        return ILoginService.login(user);
    }

    @GetMapping("logout")
    public RequestResult logout(){
        return ILoginService.logout();
    }
}
